<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  props: {
    isActive: Boolean,
    text: String,
  },
});
</script>

<template>
  <view class="tab-item">
    <template v-if="isActive">
      <view class="tab-item-active">{{ text }}</view>
      <view class="tab-item-line"></view>
    </template>
    <view class="tab-item-text" v-else>{{ text }}</view>
  </view>
</template>

<style lang="scss">
.tab-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 82rpx;

  .tab-item-text {
    margin-top: 10rpx;
    font-size: 30rpx;
    color: #666666;
    line-height: 44rpx;
  }

  .tab-item-active {
    margin-top: 12rpx;
    margin-bottom: 8rpx;
    font-size: 36rpx;
    color: #ff7900;
    line-height: 54rpx;
    font-weight: bold;
  }

  .tab-item-line {
    width: 40rpx;
    height: 8rpx;
    border-radius: 4rpx;
    background: linear-gradient(111deg, #ff7900 12%, #fac03b 90%);
  }
}
</style>